Port IMAGE - DEFAULT

Default port for interaction with the frame grabber

Stimulation

此端口不具备激励能力。

Specifics

In addition to the image data this port can access the I/O ports of the frame grabber. This can be done with the port jobs or the option Show state of I/O ports in video that writes the current state of the I/O ports in the upper right corner of the recorded video:

../../../_images/Goepel_IO_crop.png

Every pixel represents the state of an I/O port in ascending order from right to left. A pixel value greater than 128 represents one, otherwise zero.

../../../_images/Goepel_IO.png

The frame grabber in the example image has configured 6 input and 6 output ports. The first 6 pixels are for input and the remaining for output:

Input: [1, 0, 1, 1, 0, 1]

Output: [0, 1, 0, 1, 0, 0]

The option Show binary timestamp in video works in a similar way. The current timestamp of the grabber in nanoseconds is stored in a 64 bit unsigned integer and written to the first 64 pixels in the upper left corner of the frame. A pixel value greater than 128 corresponds to a one, otherwise zero. The most significant bit is the first one (big-endian).

../../../_images/Goepel_timestamp.gif

So this example image corresponds to 345959656981240 nanoseconds:

../../../_images/Goepel_timestamp_345959656981240.png

The following sample code can be used to read the binary timestamp from an image and convert it to a Unix timestamp:

import numpy as np

def ReadTimestampFromImage(image: np.ndarray):
    """
    The grabber can write 64 bit binary timestamps into a video frame. This corresponds to ns
    since 01.01.1970. As standard, the timestamps will appear in the top left corner of the
    frame, each pixel corresponding to one bit.

    :param image: Raw matrix of the image, e.g. image.ToGrayscale().GetData()
    :type image: np.ndarray
    """
    # convert first 64 pixels of image to binary array
    rawTs = image[0, 0:64, 0] > 125
    # convert logical array to number
    nanoSecondTs = 0
    for i in range(64):
        nanoSecondTs |= int(rawTs[63-i]) << i
    # Return the timestamp in seconds
    return nanoSecondTs / 1e9

Name

在以下情况下可用

默认值

有效值

Type

Description

Frame grabber interface name

[ONLINE]

string

Name of the LVDS interface which serves as frame grabber.

LVDS channel

0

int

LVDS channel for interfaces supporting multiple LVDS channels.

Name of I/O interface

[ONLINE]

string

Name of I/O interface.

Software reset on tool start

☐

bool

Performs a software reset on the LVDS device before loading the config and start grabbing.

Configuration

use existing

[use existing, load file]


显示值:

  • use existing: Use already loaded configuration

  • load file: Load XML configuration

string

This option determines whether Eecu.test should load an XML configuration file to the hardware at the beginning of the connection setup. Alternatively, the existing configuration is used. In this case, the connection to the frame grabber must be set up manually via DragonSuite before.

Path to the configuration file

Configuration: ‘load file’

uri

Path to the XML configuration file with which the LVDS interface is to be configured. Such an XML file can be generated via DragonSuite.

Show state of I/O ports in video

☐

bool

Shows the current state of I/O ports in the right upper corner of the video.

Show binary timestamp in video

☐

bool

The current timestamp of the grabber in nanoseconds is stored in a 64 bit unsigned integer and written to the first 64 pixels in the upper left corner of the frame.

Swap red and blue

☐

bool

Sets the color channel layout to BGR, instead of RGB.

Live preview

☐

bool

在配置的网络端口上流式传输实时预览。可通过工具主机的 IP 地址和配置的端口访问实时流,例如本地工具连接:http://127.0.0.1:<port>

打开预览窗口

实时预览

☑

bool

加载配置时打开预览窗口。该窗口以直播流形式显示图像源的当前输出,并且在测试配置激活期间始终保持打开。

Port

实时预览

‘<auto>’

string

用于实时流的网络端口。如果为多个视频源启用实时流,则每个实时流都需要一个唯一的端口。如果将该值设为 <auto>,系统将分配一个空闲的网络端口。

Show text overlay in video recordings

☐

bool

在视频 Recording 的左下角添加格式为 “timestamp package name” 的文本叠加。

ReadDigitalInputs

Reads the current state of all digital inputs and returns them as a list

Parameterization

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

return

object

List with states of all input ports

ReadDigitalOutputs

Reads the current state of all digital outputs and returns them as a list

Parameterization

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

return

object

List with states of all output ports

WriteDigitalOutput

Writes value to digital output port

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

port

1

int

Index of the output port starting with 1

value

☐

bool

New state of the output port